from celery import Celery

import os

# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'meiduo_mall.settings.dev')
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    # os.getenv()获取环境变量
    os.environ['DJANGO_SETTINGS_MODULE'] = 'ajia08.settings.settings'

celery_app = Celery('ajia08')

celery_app.config_from_object('celery_tasks.config')

# 让 celery_app 自动捕获目标地址下的任务:
# 自动捕获 tasks
celery_app.autodiscover_tasks(['celery_tasks.SMS',
                               ])
